//
//  SunTabBarVC.m
//  PlayerVH
//
//  Created by 彭冲 on 24/5/18.
//  Copyright © 2018年 彭冲. All rights reserved.
//

#import "SunTabBarVC.h"
#import "SunNavigationVC.h"
#import "FirstVC.h"
#import "MessageVC.h"

@implementation SunTabBarVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    FirstVC *mainVC = [[FirstVC alloc] init];
    mainVC.title = @"首页";
    SunNavigationVC *nav = [[SunNavigationVC alloc] initWithRootViewController:mainVC];
    
    MessageVC *msgVC = [[MessageVC alloc] init];
    msgVC.title = @"消息";
    SunNavigationVC *nav2 = [[SunNavigationVC alloc] initWithRootViewController:msgVC];
  
    self.viewControllers = @[nav, nav2];
}

#pragma mark //重写这三个方法，返回当前展示页面的屏幕选择需求
- (BOOL)shouldAutorotate {
    return [self.selectedViewController shouldAutorotate];
}

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
    return [self.selectedViewController supportedInterfaceOrientations];
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return [self.selectedViewController preferredInterfaceOrientationForPresentation];
}

@end
